package com.controller.Front;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.common.mybatis.Page;
import com.controller.base.BaseController;
import com.entity.Abouts;
import com.entity.News;
import com.entity.NewsInformation;
import com.entity.UserIndustry;
import com.service.AboutsService;
import com.service.IndustryService;
import com.service.NewsInformationService;
import com.service.NewsService;
/**
 * 前端页面总控制器
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/front/") 
public class FrontEndController extends BaseController<Object>{
	
	//用户行业
	@Autowired
	private IndustryService IndService;
	
	//二级栏目
	@Autowired
	private NewsService NewsServ;
	
	//关于我们
	@Autowired
	private AboutsService  AboutsServ;
	

	//新闻详情
	@Autowired
	private NewsInformationService NewsInforServ;
	/**
	 * 关于我们
	 * @return
	 */
	@RequestMapping("/about")
	public ModelAndView about(){
		ModelAndView mv=new ModelAndView();
		Abouts o=new Abouts();
		List<Abouts> AboutsList=AboutsServ.find(o);
		mv.addObject("AboutsList", AboutsList.get(0));
		mv.setViewName("FrontEnd/about");
		return mv;
	}
	/**
	 * 产品上传
	 * @return
	 */
	@RequestMapping("/cpsc")
	public ModelAndView cpsc(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/cpsc");
		return mv;
	}


	/**
	 * 金融机构
	 * @return
	 */
	@RequestMapping("/Finstitution")
	public ModelAndView Finstitution(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/jrjg");
		return mv;
	}
	
	/**
	 * 推荐产品
	 * @return
	 */
	@RequestMapping("/Recommend")
	public ModelAndView Recommend(){
		ModelAndView mv=new ModelAndView();
		Page<UserIndustry> page=new Page<>();
		Page<UserIndustry> PaIndList= IndService.findByPage(new UserIndustry(), page);
		mv.addObject("PaIndList", PaIndList.getResults());
		mv.setViewName("FrontEnd/Recommend");
		return mv;
	}
	

	/**
	 * 融资产品
	 * @return
	 */
	@RequestMapping("/Fproducts")
	public ModelAndView Fproducts(){
		ModelAndView mv=new ModelAndView();
		Page<UserIndustry> page=new Page<>();
		Page<UserIndustry> PaIndList= IndService.findByPage(new UserIndustry(), page);
		mv.addObject("PaIndList", PaIndList.getResults());
		mv.setViewName("FrontEnd/rzcp");
		return mv;
	}
	
	
	
	/**
	 * 对接企业
	 * @return
	 */
	@RequestMapping("/DockingEnterprise")
	public ModelAndView DockingEnterprise(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/djqy");
		return mv;
	}
	
	/**
	 * 对接企业
	 * @return
	 */
	@RequestMapping("/FinancingResults")
	public ModelAndView FinancingResults(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/djjg");
		return mv;
	}
	
	/**
	 * 融资需求
	 * @return
	 */
	@RequestMapping("/finance")
	public ModelAndView finance(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/finance");
		return mv;
	}
	
	
	@RequestMapping("/fwpj")
	public ModelAndView fwpj(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/fwpj");
		return mv;
	}
	
	/**
	 * 帮助中心
	 * @return
	 */
	@RequestMapping("/help")
	public ModelAndView help(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/help");
		return mv;
	}
	/***
	 * 跳转首页
	 * @return
	 */
	@RequestMapping("/index")
	public ModelAndView index(Page<NewsInformation> page){
		ModelAndView mv=new ModelAndView();
		//查询通知
		Page<NewsInformation> newPages =NewsInforServ.findByPage(new NewsInformation(), page);
		List<NewsInformation> NewsList=newPages.getResults();
		//查询轮播图片
		Page<News> indPages =NewsServ.findByPage(new News(),new Page<News>());
		System.out.println("indPages-----"+indPages);
		mv.addObject("indPages", indPages.getResults());
		mv.addObject("NewsList", NewsList);
		mv.setViewName("FrontEnd/index");
		return mv;
	}
	
	@RequestMapping("/jsxz")
	public ModelAndView jsxz(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/jsxz");
		return mv;
	}
	

	
	/**
	 * 新闻咨询页面
	 * @return
	 */
	@RequestMapping("/news")
	public ModelAndView news(News o){
		o.setColumnId("1");
		ModelAndView mv=new ModelAndView();
		List<News> newsList=NewsServ.findByCid(o);
		mv.addObject("newsList", newsList);
		mv.setViewName("FrontEnd/news");
		return mv;
	}
	
	/**
	 * 国家政策
	 * @return
	 */
	@RequestMapping("/NationalPolicy")
	public ModelAndView NationalPolicy(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/gjzc");
		return mv;
	}
	
	/**
	 * 本地政策
	 * @return
	 */
	@RequestMapping("/LocalPolicy")
	public ModelAndView LocalPolicy(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/bdzc");
		return mv;
	}
	
	
	
	/**
	 * 热门项目
	 * @return
	 */
	@RequestMapping("/HotItems")
	public ModelAndView HotItems(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/rmxm");
		return mv;
	}
	
	/**
	 * 金融政策
	 * @return
	 */
	@RequestMapping("/FinancialPolicy")
	public ModelAndView FinancialPolicy(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/jrzc");
		return mv;
	}
	
	
	/**
	 * 金融知识
	 * @return
	 */
	@RequestMapping("/FinancialKnowledge")
	public ModelAndView FinancialKnowledge(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/jrzs");
		return mv;
	}
	
	
	/**
	 * 辖区动态
	 * @return
	 */
	@RequestMapping("/Jurisdiction")
	public ModelAndView Jurisdiction(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/xqdt");
		return mv;
	}
	
	


	
	/**
	 * 审核状态
	 * @return
	 */
	@RequestMapping("/Audit")
	public ModelAndView Audit(){
		ModelAndView mv=new ModelAndView();
		Page<UserIndustry> page=new Page<>();
		Page<UserIndustry> PaIndList= IndService.findByPage(new UserIndustry(), page);
		mv.addObject("PaIndList", PaIndList.getResults());
		mv.setViewName("FrontEnd/AuditStatus");
		return mv;
	}
	

	
	/**
	 * 信用评级
	 * @return
	 */
	@RequestMapping("/CreditRating")
	public ModelAndView CreditRating(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/xypj");
		return mv;
	}
	
	
	/**
	 * 服务评级
	 * @return
	 */
	@RequestMapping("/ServiceRating")
	public ModelAndView ServiceRating(){
		ModelAndView mv=new ModelAndView();
		mv.setViewName("FrontEnd/fwpj");
		return mv;
	}
	
	

	
	
}
